package org.tloss.games.mummy;

import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class Utils {

	public static void drawButton(SpriteBatch batch, BitmapFont font,
			String text, float x, float y) {

		batch.enableBlending();
		batch.begin();
		batch.draw(Assets.button, x, y);
		batch.end();
		TextBounds bounds = Assets.font.getBounds(text);
		float fontX = x + Assets.BUTTON_WIDTH / 2 - bounds.width / 2;
		float fontY = y + Assets.BUTTON_HEIGHT / 2 + bounds.height / 2;
		batch.begin();
		font.draw(batch, text, fontX, fontY);
		batch.end();
	}

}
